Imports Microsoft.VisualBasic
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Drawing
Imports System.Resources


Imports System.Windows.Forms


Namespace Phoenix.Tools.Backup
	Public Class FinalPage : Inherits Phoenix.Tools.WizardPageBase
		#Region "Page controls"

		Private lblFinishHint As System.Windows.Forms.Label
		Private lblDescription As System.Windows.Forms.Label
		Private imgWelcome As System.Windows.Forms.PictureBox
		Private lblWizardName As System.Windows.Forms.Label
		Private lblOperation As System.Windows.Forms.Label
		Private txtOperation As System.Windows.Forms.Label
		Private txtServer As System.Windows.Forms.Label
		Private lblServer As System.Windows.Forms.Label
		Private txtDatabase As System.Windows.Forms.Label
		Private lblDatabase As System.Windows.Forms.Label
		Private txtLogin As System.Windows.Forms.Label
		Private lblLogin As System.Windows.Forms.Label
		Private txtBackup As System.Windows.Forms.Label
		Private lblBackup As System.Windows.Forms.Label
		Private lblAdditional As System.Windows.Forms.Label
		Private btnAddvanced As System.Windows.Forms.Button
		Private components As System.ComponentModel.IContainer = Nothing
		#End Region

		#Region "Class Properties"
		Public Manager As OperationManager

		Protected Overrides ReadOnly Property DefaultSize() As System.Drawing.Size
			Get
				Return New Size(498, 328)
			End Get
		End Property
		#End Region	

		#Region "Class Constructor/Finilize methods"
		Public Sub New()
			InitializeComponent()

			Me.Size = New Size(498, 328)
			Me.Name = "wizFinalPage"
			MyBase.WelcomePage = True

			MyBase.Title = lblWizardName.Text
			MyBase.Description = lblDescription.Text
			MyBase.HeaderImage = imgWelcome.Image
			MyBase.FinishPage = True
		End Sub

		Protected Overrides Overloads Sub Dispose(ByVal disposing As Boolean)
			If disposing AndAlso Not components Is Nothing Then
				components.Dispose()
			End If

			MyBase.Dispose(disposing)
		End Sub
		#End Region

		#Region "Designer generated code"
		''' <summary>
		''' Required method for Designer support - do not modify
		''' the contents of this method with the code editor.
		''' </summary>
		Private Sub InitializeComponent()
			Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FinalPage))
			Me.lblDescription = New System.Windows.Forms.Label()
			Me.lblWizardName = New System.Windows.Forms.Label()
			Me.imgWelcome = New System.Windows.Forms.PictureBox()
			Me.lblFinishHint = New System.Windows.Forms.Label()
			Me.lblOperation = New System.Windows.Forms.Label()
			Me.txtOperation = New System.Windows.Forms.Label()
			Me.txtServer = New System.Windows.Forms.Label()
			Me.lblServer = New System.Windows.Forms.Label()
			Me.txtDatabase = New System.Windows.Forms.Label()
			Me.lblDatabase = New System.Windows.Forms.Label()
			Me.txtLogin = New System.Windows.Forms.Label()
			Me.lblLogin = New System.Windows.Forms.Label()
			Me.txtBackup = New System.Windows.Forms.Label()
			Me.lblBackup = New System.Windows.Forms.Label()
			Me.lblAdditional = New System.Windows.Forms.Label()
			Me.btnAddvanced = New System.Windows.Forms.Button()
			Me.SuspendLayout()
			' 
			' lblDescription
			' 
			Me.lblDescription.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
			Me.lblDescription.BackColor = System.Drawing.Color.Transparent
			Me.lblDescription.Location = New System.Drawing.Point(184, 64)
			Me.lblDescription.Name = "lblDescription"
			Me.lblDescription.Size = New System.Drawing.Size(722, 32)
			Me.lblDescription.TabIndex = 10
			Me.lblDescription.Text = "You have created the following operation settings:"
			' 
			' lblWizardName
			' 
			Me.lblWizardName.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
			Me.lblWizardName.BackColor = System.Drawing.Color.Transparent
			Me.lblWizardName.Font = New System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (CByte(204)))
			Me.lblWizardName.Location = New System.Drawing.Point(184, 8)
			Me.lblWizardName.Name = "lblWizardName"
			Me.lblWizardName.Size = New System.Drawing.Size(722, 48)
			Me.lblWizardName.TabIndex = 9
			Me.lblWizardName.Text = "Completing the Backup or Restore Wizard"
			' 
			' imgWelcome
			' 
			Me.imgWelcome.Dock = System.Windows.Forms.DockStyle.Left
			Me.imgWelcome.Image = (CType(resources.GetObject("imgWelcome.Image"), System.Drawing.Image))
			Me.imgWelcome.Location = New System.Drawing.Point(0, 0)
			Me.imgWelcome.Name = "imgWelcome"
			Me.imgWelcome.Size = New System.Drawing.Size(168, 761)
			Me.imgWelcome.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
			Me.imgWelcome.TabIndex = 8
			Me.imgWelcome.TabStop = False
			' 
			' lblFinishHint
			' 
			Me.lblFinishHint.Anchor = (CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles))
			Me.lblFinishHint.BackColor = System.Drawing.Color.Transparent
			Me.lblFinishHint.Location = New System.Drawing.Point(184, 718)
			Me.lblFinishHint.Name = "lblFinishHint"
			Me.lblFinishHint.Size = New System.Drawing.Size(673, 40)
			Me.lblFinishHint.TabIndex = 11
			Me.lblFinishHint.Text = "To close this wizard and start the backup or restore, click Finish."
			' 
			' lblOperation
			' 
			Me.lblOperation.Location = New System.Drawing.Point(184, 104)
			Me.lblOperation.Name = "lblOperation"
			Me.lblOperation.Size = New System.Drawing.Size(100, 16)
			Me.lblOperation.TabIndex = 12
			Me.lblOperation.Text = "Operation:"
			' 
			' txtOperation
			' 
			Me.txtOperation.Location = New System.Drawing.Point(296, 104)
			Me.txtOperation.Name = "txtOperation"
			Me.txtOperation.Size = New System.Drawing.Size(400, 16)
			Me.txtOperation.TabIndex = 13
			Me.txtOperation.Text = "txtOperation"
			' 
			' txtServer
			' 
			Me.txtServer.Location = New System.Drawing.Point(296, 128)
			Me.txtServer.Name = "txtServer"
			Me.txtServer.Size = New System.Drawing.Size(400, 16)
			Me.txtServer.TabIndex = 15
			Me.txtServer.Text = "txtServer"
			' 
			' lblServer
			' 
			Me.lblServer.Location = New System.Drawing.Point(184, 128)
			Me.lblServer.Name = "lblServer"
			Me.lblServer.Size = New System.Drawing.Size(100, 16)
			Me.lblServer.TabIndex = 14
			Me.lblServer.Text = "SQL Server:"
			' 
			' txtDatabase
			' 
			Me.txtDatabase.Location = New System.Drawing.Point(296, 176)
			Me.txtDatabase.Name = "txtDatabase"
			Me.txtDatabase.Size = New System.Drawing.Size(400, 16)
			Me.txtDatabase.TabIndex = 17
			Me.txtDatabase.Text = "txtDatabase"
			' 
			' lblDatabase
			' 
			Me.lblDatabase.Location = New System.Drawing.Point(184, 176)
			Me.lblDatabase.Name = "lblDatabase"
			Me.lblDatabase.Size = New System.Drawing.Size(100, 16)
			Me.lblDatabase.TabIndex = 16
			Me.lblDatabase.Text = "Database:"
			' 
			' txtLogin
			' 
			Me.txtLogin.Location = New System.Drawing.Point(296, 152)
			Me.txtLogin.Name = "txtLogin"
			Me.txtLogin.Size = New System.Drawing.Size(400, 16)
			Me.txtLogin.TabIndex = 19
			Me.txtLogin.Text = "txtLogin"
			' 
			' lblLogin
			' 
			Me.lblLogin.Location = New System.Drawing.Point(184, 152)
			Me.lblLogin.Name = "lblLogin"
			Me.lblLogin.Size = New System.Drawing.Size(100, 16)
			Me.lblLogin.TabIndex = 18
			Me.lblLogin.Text = "Login:"
			' 
			' txtBackup
			' 
			Me.txtBackup.Location = New System.Drawing.Point(296, 200)
			Me.txtBackup.Name = "txtBackup"
			Me.txtBackup.Size = New System.Drawing.Size(400, 16)
			Me.txtBackup.TabIndex = 21
			Me.txtBackup.Text = "txtBackup"
			' 
			' lblBackup
			' 
			Me.lblBackup.Location = New System.Drawing.Point(184, 200)
			Me.lblBackup.Name = "lblBackup"
			Me.lblBackup.Size = New System.Drawing.Size(100, 16)
			Me.lblBackup.TabIndex = 20
			Me.lblBackup.Text = "Backup Directory:"
			' 
			' lblAdditional
			' 
			Me.lblAdditional.Location = New System.Drawing.Point(184, 232)
			Me.lblAdditional.Name = "lblAdditional"
			Me.lblAdditional.Size = New System.Drawing.Size(216, 32)
			Me.lblAdditional.TabIndex = 22
			Me.lblAdditional.Text = "To specify additional restore options, click Advanced."
			Me.lblAdditional.Visible = False
			' 
			' btnAddvanced
			' 
			Me.btnAddvanced.FlatStyle = System.Windows.Forms.FlatStyle.System
			Me.btnAddvanced.Location = New System.Drawing.Point(408, 226)
			Me.btnAddvanced.Name = "btnAddvanced"
			Me.btnAddvanced.Size = New System.Drawing.Size(80, 23)
			Me.btnAddvanced.TabIndex = 23
			Me.btnAddvanced.Text = "&Advanced..."
			Me.btnAddvanced.Visible = False
			' 
			' FinalPage
			' 
			Me.BackColor = System.Drawing.Color.White
			Me.Controls.Add(Me.btnAddvanced)
			Me.Controls.Add(Me.lblAdditional)
			Me.Controls.Add(Me.txtBackup)
			Me.Controls.Add(Me.lblBackup)
			Me.Controls.Add(Me.txtLogin)
			Me.Controls.Add(Me.lblLogin)
			Me.Controls.Add(Me.txtDatabase)
			Me.Controls.Add(Me.lblDatabase)
			Me.Controls.Add(Me.txtServer)
			Me.Controls.Add(Me.lblServer)
			Me.Controls.Add(Me.txtOperation)
			Me.Controls.Add(Me.lblOperation)
			Me.Controls.Add(Me.lblDescription)
			Me.Controls.Add(Me.lblWizardName)
			Me.Controls.Add(Me.imgWelcome)
			Me.Controls.Add(Me.lblFinishHint)
			Me.Name = "FinalPage"
			Me.Size = New System.Drawing.Size(924, 761)
			Me.ResumeLayout(False)

		End Sub
		#End Region

		#Region "Class overrides"

		Protected Overrides Sub OnHeaderImageChanged()
			imgWelcome.Image = MyBase.HeaderImage
		End Sub

		Protected Overrides Sub OnTitleChanged()
			lblWizardName.Text = MyBase.Title
		End Sub

		Protected Overrides Sub OnDescriptionChanged()
			lblDescription.Text = MyBase.Description
		End Sub

		Protected Overridable Sub OnDescription2Changed()
		End Sub
		Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
			OnImageListChanged()
			OnHeaderImageChanged()
			MyBase.OnLoad(e)
		End Sub
		#End Region

		Protected Friend Overrides Sub OnPageShown()
			If Manager.BackupMode Then
				txtOperation.Text = "Backup database"
			Else
				txtOperation.Text = "Restore database"
			End If

			If Manager.DBWindowAuthentication Then
				txtLogin.Text = "Windows Authorization"
			Else
				txtLogin.Text = Manager.DBUsername
			End If

			txtServer.Text = Manager.DBServer
			txtDatabase.Text = Manager.DBDatabase
			txtBackup.Text = Manager.BackupFile
			btnAddvanced.Enabled = Not Manager.BackupMode

			WizardPageParent.WizardButtons = WizardForm.TWizardsButtons.AllShortFinishEnabled
		End Sub

	End Class
End Namespace

